<template>
  <cost-consum-page
    type="hydrogenConsum"
    :equipmentId="equipmentId"
    :queryFormItem="queryFormItem"
    :collapseFormItem="collapseFormItem"
  />
</template>

<script>
import costConsumPage from '../components/costConsumPage.vue'
import { typeClassName } from "@/pages/config/classNameMap";
import mixin from "@/pages/components/mixins/mixin";

export default {
  components: { costConsumPage },
  mixins: [mixin],
  computed: {
    queryFormItem() {
      return [
        {
          key: "timeRange",
          title: {
            "zh-CN": "时间区间",
            "en-US": "timeRange",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "datetimeRange" },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "timeRange",
          title: {
            "zh-CN": "时间区间",
            "en-US": "timeRange",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "datetimeRange" },
        },
      ];
    },
  },
  data() {
    return {
      equipClassObject: null,
      equipmentId: null
    }
  },
  created() {
    let condition = "className == 'Equipment' && type == 'templateDictionary' && sf_name like '%制氢%' && sf_category like '%0%'"
    this.equipClassObject = this.$modelObject.create(`${typeClassName["equipment"].modelType}Collection`);
    this.equipClassObject.query(condition).then(res => {
      this.equipmentId = this.equipClassObject.records[0].id
    })
  }
}
</script>

<style scoped lang="scss">

</style>